package com.aizhixin.lab.company.repository;

import com.aizhixin.lab.account.dto.AccountDTO;
import com.aizhixin.lab.company.entity.User;

import java.util.ArrayList;
import java.util.List;

import com.aizhixin.lab.project.template.entity.Project;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

public interface UserRepository extends JpaRepository<User, Long> {
    public User findByAccountId(Long accountId);
    public List<User> findByDeleteFlag(Integer deleteFlag);
    public User findByIdAndDeleteFlag(Long id, Integer deleteFlag);
    public User findByUserNameAndDeleteFlagNot(String userName, Integer deleteFlag);
    public User findByAccountIdAndRoleAndDeleteFlag(Long accountId, String role, Integer deleteFlag);
    public List<User> findAllByIdIn(List<Long> accountIds);
    public Long countByClassIdAndDeleteFlag(Long classId,Integer deleteFlag);
    public Long countByProfessionalIdAndDeleteFlag(Long professionalId,Integer deleteFlag);
    public Long countByProfessionalIdAndDeleteFlagAndRole(Long professionalId,Integer deleteFlag,String role);
    public Long countByCollegeIdAndDeleteFlag(Long collegeId,Integer deleteFlag);
    public Long countByClassIdInAndDeleteFlag(List<Long> classIds,Integer deleteFlag);
    public User findByUserName(String userName);
    public User findByUserNameAndDeleteFlag(String userName,Integer deleteFlag);
    public User findByUserNameAndDeleteFlagAndIdNot(String userName, Integer deleteFlag,Long id);
    public User findByJobNumAndDeleteFlag(String jobNum,Integer deleteFlag);
    Page<User> findByClassIdAndDeleteFlag(Pageable page,Long classId, Integer deleteFlag);
}
